/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sistemperpustakaan.utility;

/**
 *
 * @author EKo
 */
public class UserUtility {

    public static final int BUKU = 0;
    public static final int JENIS_BUKU = 1;
    public static final int KATEGORI_BUKU = 2;
    public static final int PENERBIT = 3;
    public static final int ANGGOTA = 4;
    public static final int INVENTARIS = 5;
    public static final int SETTINGDENDA = 6;
    public static final int PEMINJAMAN = 7;
    public static final int USER = 8;
    public static final int TYPE_USER = 9;
    public static final int INSERT_UPDATE_DELETE= 10;
    public static final int SETTING_LIBUR = 11;
    public static final int UBAH_PASSWORD = 12;
    public static boolean[] privilege = new boolean[13];
    public static String idUser = "";
    public static String name = "";

    public UserUtility(String priv) {
        setPrivilege(priv);
    }

    private void setPrivilege(String text) {
        String priv = text;
        for (int i = 0; i < 13; i++) {
            if (priv.substring(i, i + 1).equals("1")) {
                privilege[i] = true;
            } else {
                privilege[i] = false;
            }
//            System.out.println(i);
        }
    }

    public static void initUser() {
        for (int i = 0; i < 13; i++) {
            privilege[i] = false;
        }
    }
}
